
/**
 * Module dependencies.
 */
/*
var express = require('express');
var routes = require('./routes');
var http = require('http');
var path = require('path');

var app = express();

// all environments
app.set('port', process.env.VMC_APP_PORT || 3000);
app.set('host', process.env.VCAP_APP_HOST  || 'localhost');
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(express.json());
app.use(express.urlencoded());
app.use(express.methodOverride());
app.use(express.cookieParser('your secret here'));
app.use(express.session());
app.use(app.router);
app.use(express.static(path.join(__dirname, 'public')));

// development only
if ('development' == app.get('env')) {
  app.use(express.errorHandler());
}

app.get('/', routes.index);



http.createServer(app).listen(app.get('port'), app.get('host'), function(){
  console.log('Express server listening on port ' + app.get('port'));
});
*/

var port = (process.env.VMC_APP_PORT || 3000);
var host = (process.env.VCAP_APP_HOST || 'localhost');
//var http = require('http');
var http = require('express');
var mysql = require('mysql');

  console.log('111');

 var app = http.createServer();
 app.get('/', function(req, res) {

	 console.log('222');
var conn = mysql.createConnection({
	host:'10.4.3.92',
	user:'uubkI2SYedlG6',
	password:'pyjcdoWmAxe6G',
	database:'d21df30e4e62b4da39d3f6e879d8d2398',
	port:'3306'
});
  console.log('33333333333333333333');
conn.connect();
  console.log('4444444444444444444444');

    res.send('Hello fromtest');
    });
 app.listen(port, host);





//http.createServer(function (req, res) {

  


//var insertdata = {title : 'mycategory'};
//conn.query('insert into category set ?', insertdata, function(err, result){
//	console.log("----2" + result);	
//});


 // console.log('5555555555555');

 // res.writeHead(200, {'Content-Type': 'text/plain'});
 // res.end('Hello World From MoPaaS\n');

//}).listen(port, host);





/*var conn = mysql.createConnection({
	host:'localhost',
	user:'root',
	password:'root',
	database:'docmanagement',
	port:'3306'
});
*/
